'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const s = require('../../stringify/stringifyNumber.cjs'),
  e = t => typeof t == 'bigint' || Number.isInteger(t),
  o = (t, n, i, { intAsBigInt: r }) =>
    r ? BigInt(t) : parseInt(t.substring(n), i);
function g(t, n, i) {
  const { value: r } = t;
  return e(r) && r >= 0 ? i + r.toString(n) : s.stringifyNumber(t);
}
const f = {
    identify: t => e(t) && t >= 0,
    default: !0,
    tag: 'tag:yaml.org,2002:int',
    format: 'OCT',
    test: /^0o[0-7]+$/,
    resolve: (t, n, i) => o(t, 2, 8, i),
    stringify: t => g(t, 8, '0o'),
  },
  y = {
    identify: e,
    default: !0,
    tag: 'tag:yaml.org,2002:int',
    test: /^[-+]?[0-9]+$/,
    resolve: (t, n, i) => o(t, 0, 10, i),
    stringify: s.stringifyNumber,
  },
  a = {
    identify: t => e(t) && t >= 0,
    default: !0,
    tag: 'tag:yaml.org,2002:int',
    format: 'HEX',
    test: /^0x[0-9a-fA-F]+$/,
    resolve: (t, n, i) => o(t, 2, 16, i),
    stringify: t => g(t, 16, '0x'),
  };
exports.int = y;
exports.intHex = a;
exports.intOct = f;
